package com.bw.z.mvp.view.video;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import androidx.fragment.app.Fragment;
import androidx.viewpager.widget.ViewPager;

import com.bw.z.R;
import com.bw.z.mvp.view.video.adapter.VideoVpAdapter;
import com.flyco.tablayout.SlidingTabLayout;

public class VideoFragment extends Fragment {


    private View rootView;
    private SlidingTabLayout videoTab;
    private ViewPager videoVp;
    private VideoVpAdapter videoVpAdapter;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        rootView = inflater.inflate(R.layout.fragment_video, container, false);
        initView();
        return rootView;
    }

    private void initView() {
        videoTab = (SlidingTabLayout) rootView.findViewById(R.id.video_tab);
        videoVp = (ViewPager) rootView.findViewById(R.id.video_vp);
        videoVpAdapter = new VideoVpAdapter(getFragmentManager());
        videoVp.setAdapter(videoVpAdapter);
        videoTab.setViewPager(videoVp);
    }
}